﻿namespace Core.Library
{
    public class MessageUtility
    {
        public static string NoData
        {
            get { return ShowMessage(string.Empty, "Không có dữ liệu.", MessageType.Information); }
        }

        public static string JGrowl(string message)
        {
            return string.Format("<script>$.jGrowl('{0}');</script>", message);
        }

        public static string ShowMessage(string title, string message, MessageType type)
        {
            switch (type)
            {
                case MessageType.Failure:
                    return string.Format("<div class=\"nNote nFailure hideit\"><p><strong>{0}</strong>{1}</p></div>", title, message);
                case MessageType.Information:
                    return string.Format("<div class=\"nNote nInformation hideit\"><p><strong>{0}</strong>{1}</p></div>", title, message);
                case MessageType.Success:
                    return string.Format("<div class=\"nNote nSuccess hideit\"><p><strong>{0}</strong>{1}</p></div>", title, message);
                case MessageType.Warning:
                    return string.Format("<div class=\"nNote nWarning hideit\"><p><strong>{0}</strong>{1}</p></div>", title, message);  
            }
            return "";
        }
    }
}
